import { NextResponse } from 'next/server';
import { api } from '@/lib/apiService';

export async function POST(request) {
  try {
    const data = await request.json();
    
    // 调用Python后端的注册API
    const response = await api.post('auth/register', data);
    
    return NextResponse.json(response);
  } catch (error) {
    console.error('Registration error:', error);
    return NextResponse.json(
      { error: error.message || '注册失败' },
      { status: 500 }
    );
  }
}